package com.lunm.im.server.service.impl;

import com.lunm.im.server.service.UserService;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @program: mi-server
 * @author: Shawn
 * @create: 2024-12-28 18:03
 */
public class UserServiceImpl implements UserService {
    private Map<String, String> allUserMap = new ConcurrentHashMap<>();

    {
        allUserMap.put("shawn", "123");
        allUserMap.put("lisa", "123");
        allUserMap.put("luck", "123");
        allUserMap.put("lucy", "123");
        allUserMap.put("son", "123");
    }

    @Override
    public boolean login(String username, String password) {
        String pass = allUserMap.get(username);
        if (pass == null) {
            return false;
        }
        return pass.equals(password);
    }
}
